﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Wuqi.Webdiyer;
using System.Data;


/// <summary>
/// 动态生成分页导航
/// </summary>
public static class AspNetPagerHelper
{
    /// <summary>
    /// 初始化控件
    /// </summary>
    /// <param name="aspNetPager">AspNetPager 控件</param>
    /// <param name="cur">当前页(注:1为第一页)</param>
    /// <param name="count">记录总数</param>
    public static void BaseInit(this AspNetPager aspNetPager, int cur, int count, int size)
    {
        if (count == 0)
        {
            cur -= 1;
        }
        aspNetPager.FirstPageText = "首页";
        aspNetPager.PrevPageText = "上一页";
        aspNetPager.NextPageText = "下一页";
        aspNetPager.LastPageText = "尾页";
        aspNetPager.CurrentPageIndex = cur;
        aspNetPager.RecordCount = count;
        aspNetPager.PageSize = size;
    }
}